<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Unix)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGED" CONTENT="20101227;15084800">
	<STYLE TYPE="text/css">
	<!--
		@page { size: 8.27in 11.69in }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<P><BR><BR>
</P>
<P STYLE="text-decoration: none"><FONT SIZE=6 STYLE="font-size: 22pt"><B>One-dimensional
quadrature</B></FONT></P>
<P STYLE="text-decoration: none"><FONT SIZE=6 STYLE="font-size: 22pt"><B>qadrat</B></FONT></P>
<P>Evaluate the integral 
</P>
<P>\int_{0}^{x} sin(x) dx</P>
<P><BR><BR>
</P>
<P><B>Example: Can be run with F5 within the ScalaLab Editor (Ctrl-E
to open the editor)</B></P>
<P><A NAME="__DdeLink__4_1376639203"></A><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">import
java.text.DecimalFormat;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">import numal.*;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">public class Test_qadrat
extends Object implements AE_qadrat_method {</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">public static void
main(String args[]) {</FONT></P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">double q;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">double e[] = new double[4];</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">Test_qadrat testqadrat = new
Test_qadrat();</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">e[1]=e[2]=1.0e-6;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">q=Analytic_eval.qadrat(0.0,Math.PI,testqadrat,e);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">DecimalFormat fiveDigit = new
DecimalFormat(&quot;0.00000E0&quot;);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">System.out.println(&quot;Delivers:
&quot; + fiveDigit.format(q) + &quot; &quot; + (int)e[3]);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">}</FONT></P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">public double fx(double x) {</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">return (Math.sin(x));</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">}</FONT></P>
<P><BR><BR>
</P>
<P>}</P>
</BODY>
</HTML>